//
//  ModeGameViewController.m
//  ToucheTouche
//
//  Created by Jordan Montel on 09/01/12.
//  Copyright 2012 __MyCompanyName__. All rights reserved.
//

#import "ModeGameViewController.h"
#import "Extra5ViewController.h"


@implementation ModeGameViewController
@synthesize buttonAventure, buttonArcade, buttonMenu;
@synthesize alertFirstLevel;

- (IBAction)pushAventure {
    alertFirstLevel = [[UIAlertView alloc] initWithTitle:@"Aventure" message:@"Premier niveau du jeu, il faut toucher le plus de fois possible l'image" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alertFirstLevel show];
    [alertFirstLevel release];
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (alertView == alertFirstLevel) {
        if (buttonIndex == 0) {
            gameAventureViewController = [[GameAventureViewController alloc] initWithNibName:@"GameAventureViewController" bundle:nil];
            gameAventureViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
            [self presentModalViewController:gameAventureViewController animated:YES];
            [gameAventureViewController release];
        }
    }
}

- (IBAction)pushArcade {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Coming soon..." message:@"Bientôt, soit patient :)" delegate:self cancelButtonTitle:@"OK :(" otherButtonTitles:nil];
    [alert show];
    [alert release]; 
}

- (IBAction)pushMenu {
    [self setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
    [self dismissModalViewControllerAnimated:YES];
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)dealloc
{
    [buttonAventure release];
    [buttonArcade release];
    [buttonMenu release];
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [self setButtonAventure:nil];
    [self setButtonArcade:nil];
    [self setButtonMenu:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

@end
